// camera render scence

// //创建一个环境灯光
// var ambientLight = new THREE.AmbientLight( 0xffffff, 0.4 );
// scene.add( ambientLight );

// //创建一个点灯光
// var pointLight = new THREE.PointLight( 0xffffff, 0.8 );

// //给模型添加灯光
// camera.add( pointLight );

const mtlLoader = new THREE.MTLLoader()
mtlLoader.setPath("./gas_station/");
mtlLoader.load('gas station.mtl', function (materials) {
    console.log(materials)
    materials.preload();
    let objLoader = new THREE.OBJLoader();
    objLoader
        .setMaterials(materials)
        .load('gas_station/gas station.obj', function (object) {
            console.log(object)
            // object.scale.x = object.scale.y = object.scale.z = 100;
            // object.rotation.y = 500;

            // object.position.y = -50;

            scene.add(object);

            renderer.render(scene, camera);
        }, function () {
            console.log(1)
        }, function (error) {
            console.log('An error happened', error);
        });
});
